﻿using CQIE.TES.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CQIE.TES.Model;

namespace CQIE.TES.DAL
{
    public class AdminDAL:DALBase<Admin>,IAdminDAL
    {
        /// <summary>
        /// 登录 返回null失败
        /// </summary>
        /// <param name="account"></param>
        /// <param name="passworld"></param>
        /// <returns></returns>
        public Admin Login(string account, string passWold)
        {
            using (MyDB db = new MyDB())
            {
                var query = db.Admin.Where(m => m.Account == account && m.PWD == passWold).ToList();
                if (query.Count>0)
                {
                    return query.First();
                }

                return null;
            }
        }
    }
}
